package dletc.job;

public class Account {
	
	private String account;
	private double balance;
	
	public Account() {

	}
	
	
	public Account(String account, double balance) {
		super();
		this.account = account;
		this.balance = balance;
	}

	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	
	//取款方法
	public void withDrawal(double money){
		
		//取款后 余额
		double end = getBalance() - money;
		
		//验证线程不安全。
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		
		//修改余额
		setBalance(end);
		
		
	}
	
	

}
